<?php

use yii\db\Migration;

/**
 * Handles the creation of table `smslimit`.
 */
class m170417_143421_create_smslimit_table extends Migration
{


    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('smslimit', [
            'tel' => $this->char()->comment('手机号码'),
            'times'=>$this->integer(1)->unsigned()->defaultValue(0)->comment('短信的发送次数'),
            'created_at'=>$this->integer()->unsigned()->notNull()->defaultValue(0)->comment('记录创建的时间'),
            'updated_at'=>$this->integer()->unsigned()->notNull()->defaultValue(0)->comment('记录创建的时间'),
        ]);
        //给当前表添加主键
        $this->addPrimaryKey('tel','smslimit','tel');
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('smslimit');
    }
}
